import asyncio
import time
import aiohttp


async def get_page(urls):
    async with aiohttp.ClientSession() as session:
        while urls:
            url=urls.pop()
            await asyncio.sleep(0.2)
            # async with session.get(url) as response:
            #     print(f"第-----次请求：",url)
            #     await response.read()

async def main():
    urls=["http://test.baidu.com" for i in range(100000)]
    tasks=[]
    for i in range(10000):
        tasks.append(get_page(urls))

    await asyncio.gather(*tasks)

if __name__ == '__main__':
    s_time=time.time()
    res=asyncio.run(main())
    e_time=time.time()
    print("时间：",e_time-s_time)
